import { NestFactory } from '@nestjs/core';
import { UsersModule } from './users.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import { join } from 'path';

console.log(`users pwd is ${__dirname}`);

async function bootstrap() {
    const app = await NestFactory.create<NestExpressApplication>(UsersModule);
    app.useStaticAssets(join(__dirname, '..', 'public'));
    app.setBaseViewsDir(join(__dirname, '..', 'servers/email-templates'));
    app.setViewEngine('ejs');

    app.enableCors({
        origin: '*',
    });
    await app.listen(4001);
}
bootstrap();
